<?php

namespace App\Http\Controllers\Api\Hotel;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Facades\Services\HotelInfoService;

class HotelInfoController extends Controller
{
    public function createInfo(Request $request){

    	$rules = [
    		'hotel_phone' => 'required',
    		'hotel_wifi_account' => 'required',
    		'hotel_wifi_password' => 'required'
    	];

    	$this->valiDate($request,$rules);

    	HotelInfoService::createInfo($request->all());

    	return formatJsonResponse();
    }

    public function updateInfo(Request $request){
    	$rules = [
    		'hotel_phone' => 'required',
    		'hotel_wifi_account' => 'required',
    		'hotel_wifi_password' => 'required'
    	];

    	$this->valiDate($request,$rules);

    	HotelInfoService::updateInfo($request->all());

    	return formatJsonResponse();
    }

    public function getInfo(){
    	return formatJsonResponse(HotelInfoService::getInfo());
    }
}
